home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / dfpp01.zip / SKELETON.H < prev    next >
C/C++ Source or Header  |  1992-11-21  |  2KB  |  71 lines

  1. // -------- skeleton.h 
  2.  
  3. #ifndef SKELETON_H
  4. #define SKELETON_H
  5.  
  6. #include "baseclas.h"
  7.  
  8. class Skeleton : public BaseClass    {
  9.     virtual void SetColors();
  10. protected:
  11. public:
  12.     Skeleton(char *ttl, int lf, int tp, int ht, int wd, DFWindow *par)
  13.                         : BaseClass(ttl, lf, tp, ht, wd, par)
  14.             { OpenWindow(); }
  15.     Skeleton(char *ttl, int ht, int wd, DFWindow *par)
  16.                         : BaseClass(ttl, ht, wd, par)
  17.             { OpenWindow(); }
  18.     Skeleton(int lf, int tp, int ht, int wd, DFWindow *par)
  19.                         : BaseClass(lf, tp, ht, wd, par)
  20.             { OpenWindow(); }
  21.     Skeleton(int ht, int wd, DFWindow *par) : BaseClass(ht, wd, par)
  22.             { OpenWindow(); }
  23.     Skeleton(char *ttl)    : BaseClass(ttl)
  24.             { OpenWindow(); }
  25.     virtual ~Skeleton()
  26.         { if (windowstate != CLOSED) CloseWindow(); }
  27.     // -------- API messages
  28.     virtual void OpenWindow();
  29.     virtual void CloseWindow();
  30. };
  31.  
  32. #endif
  33.  
  34.  
  35. // ------------- skeleton.cpp
  36.  
  37. #include "skeleton.h"
  38.  
  39. // ----------- common constructor code
  40. void Skeleton::OpenWindow()
  41. {
  42.     if (windowstate == CLOSED)
  43.         BaseClass::OpenWindow();
  44.     SetColors();
  45.     // ..... 
  46. }
  47.  
  48. void Skeleton::CloseWindow()
  49. {
  50.     // destructor code
  51.     // .....
  52.     BaseClass::CloseWindow();
  53. }
  54.  
  55. // -------- set the fg/bg colors for the window 
  56. void Skeleton::SetColors()
  57. {
  58.     colors[STD_COLOR][FG] =
  59.     colors[STD_COLOR][BG] =
  60.     colors[SELECT_COLOR][FG] =
  61.     colors[SELECT_COLOR][BG] = BLACK;
  62.     colors[FRAME_COLOR][FG] =
  63.     colors[FRAME_COLOR][BG] =
  64.     colors[HILITE_COLOR][FG] =
  65.     colors[HILITE_COLOR][BG] = LIGHTGRAY;
  66. }
  67.  
  68.  
  69.  
  70.  
  71.